package org.csu.mypetstore.persistence;


import org.apache.ibatis.annotations.Param;
import org.csu.mypetstore.domain.Cart;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

@Repository
public interface CartMapper {
    void insertCart(@Param("cart")Cart cart, @Param("username") String username);

    List<Cart> getCartByusername(String username);

    Cart getCartByusername2(@Param("username")String username,@Param("itemid") String itemid);

    void deletecart(String username);

    void Updatecart(@Param("username")String username, @Param("itemid")String itemid, @Param("quantity")int quantity, @Param("total")BigDecimal total);

    void deletecartByusername_and_itemid(@Param("username")String username, @Param("itemid")String itemid);

    Cart isExist(@Param("username")String username,@Param("itemid") String itemid);
}
